/******************* 公共变量 *******************/
var userId = core.getUrlData('user_id'),
	sex = core.getUrlData('sex'),
	body = decodeURIComponent(core.getUrlData('body_shape'));

/******************* Vue初始化代码 *******************/
var vm = new Vue({
	el: '.wrap',
	data: {
		userId: userId,
		sex: sex,
		body_shape: body,
		boy: ['器宇轩昂', '英俊潇洒', '成熟稳重', '清新俊逸', '儒雅睿智', '含蓄内敛', '专硕魁梧', '挺拔飞扬'],
		girl: ['端庄秀丽', '清新脱俗', '小巧玲珑', '曼妙修长', '凹凸有致', '明艳动人', '婀娜多姿', '火辣丰腴']
	},
	methods: {
		save: function () {
			var _this = this;
			$.ajax({
				url: userUpdateUrl,
				type: 'post',
				data: {
					user_id: _this.userId,
					body_shape: _this.body_shape
				},
				success: function(data) {
					console.log(data)

					if (data.result == 1) {
						core.hintBack(data.message);
					} else {
						core.layerHint(data.message);
					}
				}
			});
		},
		select: function (event) {
			var $this = $(event.target);
			$this.addClass('active').siblings().removeClass('active');
			this.body_shape = $this.html();
		}
	},
	computed: {
		
	},
	components: {
		
	},
	created: function () {
		
	},
	mounted: function () {
		common.bindBack();
	}
});

